package com.botann.projects.utils;

import java.math.BigDecimal;

/**
 * Charging
 * BigDecimalUtils
 * Created by 刘山国 on 2018/11/13.
 * Copyright (c) 2017 伯坦科技. All rights reserved
 */
public class BigDecimalUtils {

    public static int compareHalfUp2(BigDecimal num1, BigDecimal num2) {
        return compareHalfUp2(num1,num2);
    }

    public static int compareHalfUpScale(BigDecimal num1, BigDecimal num2, int scale) {
        BigDecimal v1 = num1.setScale(scale,BigDecimal.ROUND_HALF_UP);
        BigDecimal v2 = num2.setScale(scale,BigDecimal.ROUND_HALF_UP);
        return v1.compareTo(v2);
    }
}
